package com.example.content.fragment.me.coin

import androidx.fragment.app.Fragment
import com.example.content.R
import com.example.content.databinding.FragmentChargeBinding
import com.example.content.fragment.BaseMvvmFragment
import com.example.content.viewmodule.me.MyPageCommonViewModel

/**
 * A simple [Fragment] subclass.
 * Use the [ChargeFragment.newInstance] factory method to
 * create an instance of this fragment.
 */
class ChargeFragment  : BaseMvvmFragment<FragmentChargeBinding, MyPageCommonViewModel>() {


    override fun initView() {
        dataBinding.titleBar.title.text = getString(R.string.charge)
    }

    override fun initListener() {
        dataBinding.titleBar.backIcon.setOnClickListener {
            activity?.finish()
        }
        dataBinding.zfbPay.setOnClickListener {
            dataBinding.zfbRadio.isChecked = true
            dataBinding.weChatRadio.isChecked = false
        }
        dataBinding.weChatPay.setOnClickListener {
            dataBinding.zfbRadio.isChecked = false
            dataBinding.weChatRadio.isChecked = true
        }
    }

    override fun getViewModuleClass(): Class<MyPageCommonViewModel> {
        return MyPageCommonViewModel::class.java
    }

    override fun getLayoutId() = R.layout.fragment_charge

    companion object {
        @JvmStatic
        fun newInstance() = ChargeFragment()
    }
}